package ltd.dujiabao.springboot.fallback;

import lombok.extern.slf4j.Slf4j;
import ltd.dujiabao.springboot.service.HystrixService;
import org.springframework.stereotype.Component;

/**
 * @author : DuJiabao
 * @Project : springcloud
 * @Time : 2021/5/22 20:28
 * @Desc :
 */
@Component
@Slf4j
public class HystrixServiceFallback implements HystrixService {
  @Override
  public String runsWell(Integer id) {
    String result = "熔断版runsWell";
    log.info(result);
    return result;
  }

  @Override
  public String runsTimeOut(Integer id) {
    String result = "熔断版runsTimeOut";
    log.info(result);
    return result;
  }

  @Override
  public String runsException(Integer id) {
    String result = "熔断版runsException";
    log.info(result);
    return result;
  }
}
